package com.woniuxy.Customclazz;

import com.woniuxy.interceptor.myinterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author：向天浩
 * @Date：2022/2/15 12:17
 * @Description :自定义的拦截器类
 */
@Configuration
public class Custominterceptor implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //new了一个我们创建的拦截器类，放入到这个类中
        registry.addInterceptor(new myinterceptor()).addPathPatterns("/one/**");
    }
}
